#include "StringUtils.h"

StringUtils::StringUtils(void) {
}

StringUtils::~StringUtils(void) {
}

bool StringUtils::ignoreCaseCompare(string string1, string string2) {

		for(unsigned int i=0; i<string1.size();++i) {
			string1[i] = tolower(string1[i]);
		}

		for(unsigned int i=0; i<string2.size();++i) {
			string2[i] = tolower(string2[i]);
		}

		return (string1.compare(string2) == 0);
		
	}

	void StringUtils::createMatrix(int row, int col) {

		char **m_array;
		int m_Rows = row;
		int m_Cols = col;

		// dynamic allocation of 2-D arrays
		int iRow;
		int iCol;
		m_array = (char **) malloc(m_Rows *sizeof(int));
		
		for(iRow=0;iRow < m_Rows;iRow++) {
			m_array[iRow] = (char *) malloc(m_Cols*sizeof(int));
		}

		for(iRow=0;iRow < m_Rows;iRow++) {
			for(iCol=0;iCol < m_Cols;iCol++) {
				m_array[iRow][iCol] = 'a';
			}
		}

		for(iRow=0;iRow < m_Rows;iRow++) {
			for(iCol=0;iCol < m_Cols;iCol++) {
				cout << m_array[iRow][iCol];
			}
			cout << endl;
		}


	
}

